<template>
  <el-calendar v-model="value">
    <template #dateCell="{ date }">
      <!-- date：当前单元格的日期对象 -->
      <!-- data：单元格的一些信息 type isSelected day -->
      <div class="date-content">
        <!-- 通过 date.getDate 方法获取几号 -->
        <span class="text">{{ date.getDate() }}</span>
        <!-- 通过 date.getDay 方法获取星期几，星期六和星期日显示“休“ -->
        <span class="rest" v-if="date.getDay() === 6 || date.getDay() === 0">休</span>
      </div>
    </template>
  </el-calendar>
</template>

<script>
export default {
  data() {
    return {
      value: new Date()
    }
  }
}
</script>

<style lang="scss" scoped>
.date-content {
  height: 70px;
  text-align: center;
  line-height: 70px;
  font-size: 14px;
}
.date-content .rest {
  color: #fff;
  border-radius: 50%;
  background: rgb(250, 124, 77);
  width: 20px;
  height: 20px;
  line-height: 20px;
  display: inline-block;
  font-size: 12px;
  margin-left: 10px;
}
.date-content .text{
  width: 20px;
  height: 20px;
  line-height: 20px;
  display: inline-block;
}
</style>